package com.weiaibenpao.demo.chislim.ui.adapter;

import android.support.v4.app.Fragment;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentPagerAdapter;

import java.util.List;

/**
 * Created by wlx on 2017/12/7.
 */

public class RunningFragmentAdapter extends FragmentPagerAdapter {
    private List<Fragment> mFragmentList;
    private List<String> mTitleList;
    public RunningFragmentAdapter(FragmentManager fm,List<Fragment> mFragmentList, List<String> mTitleList) {
        super(fm);
        this.mFragmentList=mFragmentList;
        this.mTitleList=mTitleList;
    }

    @Override
    public Fragment getItem(int position) {
        return mFragmentList.get(position);
    }

    @Override
    public int getCount() {
        return mFragmentList.size();
    }

    @Override
    public CharSequence getPageTitle(int position) {
        return mTitleList.get(position);
    }
}
